// 导入
const mongoose = require("../db/db");
// 配置字段的格式
const medicalSchema = mongoose.Schema(
  {
    username: {
      type: String,
      required: true,
    },
    phone: {
      type: Number,
      required: true,
    },
    gender: String,
    age: Number,
    message: String,
    count: Number,
    type: Number,
    createTime: {
      type: Date,
      default: Date.now(),
    }, //创建时间
  },
  {
    timestamps: false, // 时间戳
    versionKey: false, // 清除版本信息
  }
);
// 定义模型, 不用写复数
const Medical = mongoose.model("medical_records", medicalSchema);
// 输出模型
module.exports = Medical;
